home *** CD-ROM | disk | FTP | other *** search
- DC - Directory Control
- Version 1.04
- by Peter Esherick
-
- Contact via: Albuquerque PC Users' Group or
- Albuquerque RBBS 296-7672, John Maio, sysop
- Midnight Express 836-9576, Terry Stein, sysop
- Surya 294-9601, Paramjeet Singh, sysop
- ARPANET <ESHERIC@SANDIA-2.ARPA>
-
-
- Command DC
- ----------
-
- Purpose: To allow selective copying, moving, deleting and browsing
- of files displayed in a directory listing.
-
- Format: DC [d:][source-path] [d:][dest-path] [/O,N,E,D,or S][/F][/V]
-
- Remarks:
- This program is closely based on the CO and DR programs, both written
- by Michael J. Mefford and published in PC Magazine, vol.6, #17 and #21,
- 1987. I have combined features from these two programs and also added a
- number of new features of my own. This program is released into the
- public domain, as is, with no warranties of any kind. I will be happy to
- supply source code to any interested party, with the request that if you
- make any significant changes, modifications, or improvements that you
- please share these changes, preferably in source code form, with me and
- the rest of the PC user community.
-
- Usage notes:
- The source and destination directory pathnames are both optional.
- Options, specified by a "/" followed by a letter, may appear either before
- or after the pathnames. The options are as follows:
-
- /N Sort directory by filename
- /E Sort directory by extension
- /D Sort directory by date and time
- /S Sort directory by file size
- /O Use original order, i.e. do not sort directory at all.
- /V Turn on DOS Verify switch for disk file writes
- /F Fast display on IBM Color display adapters (no snow check)
-
- DC comes up displaying the "source" or "working" directory. A brief
- menu of optional commands is displayed to the right of the directory
- dispaly. You may move up and down the directory list with the up and down
- arrow keys on the cursor keypad. Files may be individually copied,
- deleted, moved or renamed by pressing the function keys F1 through F4,
- respectively. Alternatively, a number of files may be selected, or
- "marked" using the grey + and - keys on the right side of the keypad.
- After marking, pressing the appropriated function key will apply the
- chosen operation to the entire group of files.
-
- Different directories can be displayed in two ways. One is to press
- the F9 function key and enter a new drive and path name. Alternatively,
- if you want to move to different sub-directories on the same drive, you
- can simply press the "Enter" key after using the up or down arrow keys to
- high-light the desired subdirectory. Note that as always within DOS, ".."
- denotes the parent of a given subdirectory, i.e. the level above the
- currently displayed directory.
-
- Just as pressing Enter lets you view a new directory, pressing Enter
- when a filename is highlighted lets you view the contents of the file. In
- the default mode the display is wrapped at the edge of the screen if a
- line is more than 80 characters wide. This option can be toggled by
- pressing W. Display of non-ascii characters can be toggled with the Ascii
- and Blank options by pressing A or B. In Ascii mode only strings of 5 or
- more normal ascii characters (including tab or space) are displayed. This
- is useful for viewing the messages conatained in an .EXE or .COM file.
- With the Blank option, non-ascii characters are replaced with a blank or
- space. A final option, "*", masks the high-order bit of non-ascii
- characters to make wordstar files readable.
-
-
- Key by key summary of commands:
-
- Esc Exit program and return to original directory.
-
- Alt-Q Exit program leaving the currently displayed dir as the
- current default drive and directory for DOS.
-
- Grey + Mark current file entry, if not a subdirectory or hidden
- or Ins file, and advance cursor to next line.
-
- Grey - Remove mark on current file, and advance cursor to next line.
- or Del
-
- The following functions operate on the marked files, if any, otherwise
- they operate on the currently highlighted file, provided it is not a
- sub-directory entry. If the operation is successful the mark is
- replaced with an asterix (*), if unsuccessful the file is passed over,
- leaving the mark, and the program proceeds on to the next marked file.
-
- F1 Copy file(s) via a read/write sequence to requested target
-
- F2 Delete file(s) after asking for confirmation.
-
- F3 Move file(s), ie Copy to requested target, delete source.
- Where possible this function is performed using an across
- directory rename instead of a file read/write sequence.
-
- F4 Rename file(s) or <dir> within the currently displayed directory.
-
- F5 Clear all marks
-
- F6 Mark all remaining files, ie those not marked with an "*".
-
- F7 Swap marked and unmarked files.
-
- The following three functions change the active source and dest
- directories:
-
- F8 Swap the Working Directory (source) and the Default
- Destination Directory
-
- F9 Prompt for a new Working (source) Directory
-
- F10 Prompt for a new Default Destination Directory
-
- The directory can be re-sorted by typing:
-
- Alt-N Sort by filename
- Alt-E Sort by file extension (eg .COM vs .DOC)
- Alt-D Sort by date and time
- Alt-S Sort by file size
- Alt-O Re-read and display dir in original, unsorted order
-
- Additional commands not appearing in the menu:
-
- Alt F1 Protected copy - bypass filenamess that already exist on target
-
- Alt R Re-read working directory. Required after changing diskettes
- in a floppy-disk drive.
-
- Alt C Copy (Duplicates F1)
- Alt M Move (Duplicates F3)
- Alt V View (Duplicates Return)
-
- View Mode commands:
-
- Alt W Toggle word wrap/horizontal scroll
- Alt A Toggle Ascii string display
- Alt B Toggle blanking of non-Ascii characters
- * Toggle wordstar bit mask (shift non-ascii high-order
- characters (from 128 to 255) down into the displayable
- ascii range of 1 to 127.
-
-
- Customizing DC.COM
-
- Version 104e of DC can now be customized to display the menu and dir
- text in the colors of your choice. Rather than building into DC.COM an
- automatic color setting function, I have fallen back on the hacker's
- choice of letting you patch DC.COM with debug. If this scares you,
- learn how to use debug, ask a friend, or learn to love the ridiculous
- choice of colors that is built in to this version. I use a monochrome
- screen, so it just hasn't been a big thing to me before.
-
- Besides understanding DEGUG you need to know two other things: how the
- PC video display cards translates hex numbers into colors, and what
- locations to patch (change) in DC.COM. The table below lists the
- correspondance between hex numbers and foreground and background colors
- on the PC. To get the correct number for a combined foreground color
- plus background number, you add the hex digits for the two. For
- example, brown on a blue background is given by 16h, where as brown on a
- green background is given by 26h. Note that in a hexidecimal
- representation, which is what debug uses, the first digit is the
- background color, while the second (least significant) digit gives the
- foreground color.
-
- Foreground (normal) Foreground (intense) Background
- --------------------------------------------------------------
- 0 black 8 dark gray 0 black
- 1 blue 9 light blue 10h blue
- 2 green 0Ah light green 20h green
- 3 cyan 0Bh light cyan 30h cyan
- 4 red 0Ch light red 40h red
- 5 magenta 0Dh light mag. 50h magenta
- 6 brown 0Eh yellow 60h brown
- 7 gray 0Fh intense white 70h gray
-
- OK, now you now how to define a color. If you are a veteran hacker,
- than the next table tells you all you need to know. If your not,
- hold on, we'll get you there.
-
- Location Name Default Where used
- ------------------------------------------------------
- 103h NORMAL 02 Directory display
- 104h INTENSE 0Bh Pathname display
- 105h MENU 16H Menu display
- 106h BORDER 1EH Menu border
- 107h INVERSE 74H Highlighted dir entry
-
- Now, to use DEBUG to change the default colors, first
- (1) Find DEBUG.COM from your DOS disk if you haven't already got it
- (2) Use COPY to make a copy of DC.COM on a working disk so you don't
- mess up your one and only copy.
- (3) Assuming DEBUG is in the default directory or accessible via the
- path command, and that DC.COM is present in the default directory of the
- currently logged disk, type the following (at the DOS prompt):
-
- DEBUG DC.COM (Debug will respond with a hyphen -)
- d103l5 (Debug will display the current values of the colors)
- e103 (Debug will display the first color, followed by a '.',
- for example 02. At this point type in the one or two
- digit number that you want to use for the NORMAL color.
- If you don't want to change it, press the space bar.
- After entering the number or a space, debug will go on to
- the next color, and you repeat the last step until you
- have entered something for all five colors. If you want
- to quit and go back, press the Enter (return) key, and re-
- enter the e103 command at the '-' prompt. When your done
- here you only two more steps to go:
-
- W (This command writes the modified file back on to the disk.
- (Debug responds with "Writing 17F3 bytes", or something close)
-
- Q (And the Q command quits DEBUG and returns you to DOS.
-
-
- Other Patch Locations:
-
- Switch character (108h):
-
- For the UNIX hackers, there's one more byte that you can change at your
- pleasure, and that is one I have labeled SWITCH at location 108h in the
- DC.COM file. The character/byte at location 108h is used to identify an
- option entered on the DOS command line when you first call up DC.
- Normally this is '/', so that options would be specified by /d or /o. By
- changing the byte at location 108 to '-', options can be entered as -d
- or -o. This lets you use '/' in your path names, so that instead of
- entering command lines like:
-
- DC C:\COMM\DOWN D:\UTIL /D
-
- You can now enter:
-
- DC C:/COMM/DOWN D:/UTIL -D or
- DC C:\COMM\DOWN -d D:\UTIL or
- DC -d C:/COMM\DOWN D:/UTIL -D
- But not: DC C:\COMM\DOWN D:/UTIL /D (This will clearly confuse DC)
-
- (Note that since the problem is with the option switch, and since there
- are no options entered with pathnames once the programming is running,
- you can use either / or \ as a path delimiter when entering a
- destination or changing the path with F9 or F10 keys.)
-
-
- Snow Checking (109H):
-
- When DC starts up it checks BIOS data area (Segment 40) to see if the
- current display adapter is a monochrome or color card. If it isn't mono,
- then DC will query the display adapter, before writing a character to the
- display memory, to see if it is ok to do so. This procedure is necessary
- to avoid spurious dots or "snow" on old IBM Color Graphics Adapters (CGA's).
- Unfortunately, this also slows things down quite a bit. If you prefer speed
- over a clean display update, or if you have an EGA or other color display
- adapter that doesn't need to do this checking, then put 0FFh in the byte
- at 109h. A zero at this location will enable snow checking on all but
- the monochrome display adapter (which never needs it anyway). If you
- want to temporarily try out what this patch does, use the /F option
- switch when you start up DC.
-
-
- Acknowledgments:
- My thanks to Steve Grandi of U. Arizona for some helpful suggestions.
- Steve and I are currently working on revision 1.05 that adds a DOS shell
- and some other new functions to DC. Steve has also implemented a UNIX
- style "-" switch version that uses "/" instead of "\" as the path delimiter.
-
- Revision history:
-
- DC version 1.04(f) - June 13, 1988
- Add Ins/Del as duplicates to Grey +/- keys
- Fix Backspace bug that occurred on original PC's
- Work on display speed/ cursor overrun problem
- Minor(?) change in memory management
- Last ditch- moved data to end of file to save space
-
- DC version 1.03(f) - May 9, 1988
- Save and restore original text attribute
- Simplify clutter of clear window subroutines
- Add customizable option switchchar for UNIX hacks
- Fix bug occurring in copy of 0 byte size files
- Fix error that occurs when rename is applied to destination dir
- Fix writing to prn once more
- Add Refresh to original order sort
- Minor fixes and revisions to save a few bytes
- Add rename for directories
- More work on error recovery - write protected target
-
-
- DC version 1.03 - April 6, 1988
- Add customizable colors and switch-char
- Add Rename for directories
- Automatically re-read dir with Alt-O original order sort
- More work on error recovery - write protected target
-
- DC version 1.02 - March 14, 1988
- Added Alt-F1 "Protected Copy" function.
- Tweaked file view function to save 4 bytes.
- Now highlights last sub-dir viewed when returning to parent dir
-
- DC version 1.01 - March 7, 1988
- Modified method of handling directory changes
- F9 (change work dir) now relative to displayed work dir
- Allow specifying both source and dest paths on entry
-
- Earlier versions COD1 through COD9: Dec '87 to Mar. '88
- Combined DR and CO,
- Added ability to change directories
- Added more screen info on bytes free
- Added "spedometer" display of marked files, bytes
- Added "View" options to
- toggle word wrap,
- Horizontal scroll
- blanking or full suppression of non-ASCII
-
-
- Features that could be added:
-
- Sub-directory functions like RMDIR and MKDIR on directories
- Improved error messages on disk not ready, etc
-
- View options: hex dump a la Buerg's LIST.COM
- search/scan for text
- display current horizontal scroll position
- improve provisions for re-synch in mode toggles
-